home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / f90 / popcnt.z / popcnt
Text File  |  1998-10-30  |  3KB  |  81 lines

  1. POPCNT(3I)                                             Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      __ppooppccnntt, PPOOPPCCNNTT - Counts number of set bits
  6.  
  7. SSYYNNOOPPSSIISS
  8.      C/C++:
  9.  
  10.      ##iinncclluuddee <<iinnttrriinnssiiccss..hh>>
  11.      iinntt __ppooppccnntt ((lloonngg _i));;
  12.  
  13.      Fortran:
  14.  
  15.      PPOOPPCCNNTT (([II==]_i))
  16.  
  17. IIMMPPLLEEMMEENNTTAATTIIOONN
  18.      C/C++:  UNICOS and UNICOS/mk systems
  19.  
  20.      Fortran:  UNICOS, UNICOS/mk, and IRIX systems
  21.  
  22. SSTTAANNDDAARRDDSS
  23.      C/C++:  Cray Research extension
  24.  
  25.      Fortran:  CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran
  26.      90
  27.  
  28. CC//CC++++ DDEESSCCRRIIPPTTIIOONN
  29.      The __ppooppccnntt function returns the number of bits set to 1 (the
  30.      population count) in argument _i.
  31.  
  32. FFOORRTTRRAANN DDEESSCCRRIIPPTTIIOONN
  33.      This intrinsic function counts the number of bits set in the argument.
  34.      It accepts the following argument:
  35.  
  36.      _i    A Boolean, integer, real, or Cray pointer value.  On IRIX
  37.           systems, _i cannot be declared as RREEAALL((KKIINNDD==1166)).
  38.  
  39.      PPOOPPCCNNTT is an elemental function.  The name of this intrinsic cannot be
  40.      passed as an argument.
  41.  
  42. CC//CC++++ NNOOTTEESS
  43.      Because __ppooppccnntt is an intrinsic function, no externally visible
  44.      library function is available for it.  The compiler generates inline
  45.      code to produce the result.
  46.  
  47. FFOORRTTRRAANN NNOOTTEESS
  48.      The bit representation of the logical data type is not consistent
  49.      among Cray Research systems.  For further details, see your compiler's
  50.      reference manuals.
  51.  
  52. FFOORRTTRRAANN RREETTUURRNN VVAALLUUEESS
  53.      PPOOPPCCNNTT returns a value of type integer.
  54.  
  55. EEXXAAMMPPLLEESS
  56.      Fortran: The following section of Fortran code shows the PPOOPPCCNNTT
  57.      function used with an argument of type integer.  The bit pattern of
  58.      the argument and the value of the result are also given.  For
  59.      simplicity, a 16-bit object is used.
  60.  
  61.           INTEGER I1, I2
  62.           ...
  63.           I2 = POPCNT(I1)
  64.  
  65.  
  66.            ---------------------------------------------------------------
  67.           | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
  68.            ---------------------------------------------------------------
  69.                                          I1
  70.  
  71.      The PPOOPPCCNNTT function returns the value 6 to the integer variable II22.
  72.  
  73. SSEEEE AALLSSOO
  74.      A complete list of C/C++ intrinsic functions available on Cray
  75.      Research systems is in the _C_r_a_y _C/_C++ _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR
  76.      -2179.
  77.  
  78.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  79.      printed version of this man page.
  80.  
  81.